from django.conf.urls import url
from rest_framework.routers import DefaultRouter
from rest_framework_jwt.views import obtain_jwt_token

from meiduo_mall.apps.users import views
from users.views import AddressViewSet

urlpatterns = [

    url(r'^test/$', views.TestView.as_view()),
    url(r'^test2/$', views.TestView2.as_view()),

    url(r'^usernames/(?P<username>\w{5,20})/count/$', views.UsernameCountView.as_view()),

    url(r'^users/$', views.CreateUserView.as_view()),

    url(r'^authorizations/$', obtain_jwt_token),

    url(r'^user/$', views.UserView.as_view()),

    url(r'^email/$', views.EmailView.as_view()),

    url(r'^email/verification/$', views.VerifyEmailView.as_view()),

]

router = DefaultRouter()
router.register('addresses', AddressViewSet, base_name='address')
urlpatterns += router.urls
